workDialog <- function(){
	initializeDialog(title = gettext("Datos trabajo final"))
	onOK <- function() {
		doItAndPrint("data(osteoporosis, package=\"RcmdrPlugin.TeachingExtras\")")
		justDoIt(paste("set.seed(", tclvalue(dni), ")"))
		justDoIt("
						osteoporosis$EDAD <- osteoporosis$EDAD + round(runif(length(osteoporosis$EDAD),-2,2));
						osteoporosis$ALTURA <- osteoporosis$ALTURA + round(runif(length(osteoporosis$ALTURA),-3,3));
						osteoporosis$PESO <- osteoporosis$PESO + round(runif(length(osteoporosis$PESO),-2,2),1);
						osteoporosis$TEVOL <- osteoporosis$TEVOL + round(runif(length(osteoporosis$TEVOL),0,2));
						osteoporosis$SZL24 <- osteoporosis$SZL24 + round(runif(length(osteoporosis$SZL24),-0.05,0.05),2);
						osteoporosis$SZTRI <- osteoporosis$SZTRI + round(runif(length(osteoporosis$SZTRI),-0.1,0.1),2);
						osteoporosis$SZCUE <- osteoporosis$SZCUE + round(runif(length(osteoporosis$SZL24),-0.1,0.1),2)"
		)
		closeDialog()
		activeDataSet("osteoporosis")
		tkfocus(CommanderWindow())
	}
	
	OKCancelHelp(helpSubject = "osteoporosis")
	dniFrame <- tkframe(top)
	dni <- tclVar("")
	dniField <- tkentry(dniFrame, width = "10", textvariable = dni)
	tkgrid(labelRcmdr(dniFrame, text=gettext("Introduce el DNI sin letra: ")),dniField, sticky = "w")
	tkgrid(dniFrame, sticky="w")
	tkgrid(buttonsFrame, sticky = "w")
	dialogSuffix(rows = 2, columns = 1)
}
